#include <iostream>
#include <math.h>

using namespace std;
typedef unsigned long BIG;

int main()
{
	BIG n=1,j=2,c = 1;

	while(c<=500)
	{
		n += j++;
		c = 0;
		long last = (int)sqrt(n);
		for (long i=1;i<=last;i++)
		{
			if (n%i==0)
			{
				c++;
				if (n/i > i) c++;
			}
	   }
	}

	cout << n << endl;

	return 0;
}
